<%@ include file="/inc/header.jsp" %>

<html:form action="/category.do">
<html:hidden property="id" />
  <table border="0" align="center" cellspacing="0" cellpadding="0" width="75%">
    <tr>
      <th class="colored" colspan="4"><b>Modification d'une categorie</b></th>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top"> &nbsp; </td>
      <td align="left" valign="top"> &nbsp; </td>
      <td width="36%" align="center" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top">Nom :&nbsp;</td>
      <td align="left" valign="top"><html:text property="name" /></td>
      <td width="36%" align="center" valign="top">&nbsp;</td>
    </tr>
    <tr>
      <td align="left" valign="top" colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td width="5%" align="center" valign="top">&nbsp;</td>
      <td align="left" valign="top">Dans la cat&eacute;gorie :</td>
      <td width="36%" align="left" valign="top">
      <logic:present name="categorylist">
      	<%
      		int size = ((java.util.List) request.getAttribute("categorylist")).size();
      		int count = (size+3) / 2;
      		String countStr = String.valueOf(count);
      	%>
      	<logic:iterate id="category" indexId="i" name="categorylist">
			<logic:equal name="i" value="<%= countStr %>">
			  </td>
		      <td width="36%" align="left" valign="top">
			</logic:equal>
			<bean:define id="categoryId" name="category" property="id" />
			<logic:notEqual name="categoryForm" property="id" value="<%= categoryId.toString() %>">
				<html:radio idName="category" property="parentId" value="id" />&nbsp;
				<bean:write name="category" property="fullname" /><br>
			</logic:notEqual>
		</logic:iterate>
		<html:radio property="parentId" value="-1" /> Aucune
	  </logic:present>
    </td>
    </tr>
    <tr>
      <td align="left" valign="top" colspan="4">&nbsp;</td>
    </tr>
    <tr>
      <td colspan="4" align="center" valign="top">
      	<html:submit property="actionName" value="Sauver" styleClass="button" />
        &nbsp; <html:button property="foo" value="Annuler" onclick="history.back()" styleClass="button" />
      </td>
    </tr>
  </table>
</html:form>

<%@ include file="/inc/footer.jsp" %>
